import request from '@/utils/request'

// 创建仓储调拨单
export function createOrderAllot(data) {
  return request({
    url: '/storage/order-allot/create',
    method: 'post',
    data: data
  })
}

// 更新仓储调拨单
export function updateOrderAllot(data) {
  return request({
    url: '/storage/order-allot/update',
    method: 'put',
    data: data
  })
}

// 删除仓储调拨单
export function deleteOrderAllot(id) {
  return request({
    url: '/storage/order-allot/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除仓储调拨单 */
export function deleteOrderAllotList(ids) {
  return request({
    url: `/storage/order-allot/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得仓储调拨单
export function getOrderAllot(id) {
  return request({
    url: '/storage/order-allot/get?id=' + id,
    method: 'get'
  })
}

// 获得仓储调拨单分页
export function getOrderAllotPage(params) {
  return request({
    url: '/storage/order-allot/page',
    method: 'get',
    params
  })
}
// 导出仓储调拨单 Excel
export function exportOrderAllotExcel(params) {
  return request({
    url: '/storage/order-allot/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}